/**
 *  公共的请求方法
 */

import base from "@/api/base";
import axios from "@/utils/request"


const api = {
    /**
     * 获取推荐音乐
     */
    getMusic() {
        return axios.get(base.musicUrl)
    },

    /**
     * 获取最新音乐
     */
    getNewSong() {
        return axios.post(base.newsong, {
            params: 'q3lskfVcDHZ6qa/5++PhN5tWMKmcA+PIU06rbv9oxhJrfk1rPmSrn+rApeQqfE7p',
            encSecKey: '78a636c5494ff906b2a8e31d1b407875f53e7eb73401cdca54ba171a53622e00acaa45669230b882d82cc00dd6454fb95413ad729feba3f3b713d22edd23ff6834376c3895563ad18bed5fc559cb1ac7745180d6f2f77b1cd80970092564ad4e740a9c61a0a3b807583805607992110bab788799f69bad8577093dbce29d481e'
        })
    },
    /**
     * 获取热歌榜列表
     */
    getPlaylist() {
        return axios.post(base.playlist, {
            params: 'FCXFzLFkgIUQXdqcBrscLNUiu4QyIAZZMdKgMvx6ulyNn2JYCcdN6JZKJOF2gfy0',
            encSecKey: '6262cff48a4c57d320dee595d381f8daa9ef1976cdb970a5498ed42df06fe074c93e6d322cd7036c456ea745d6ce7cd401fcc6f58a16171cab2597c444991dc932c6c7562b4953399ae195f715552ebee796b8eeaa6eae9747354f0e8b7acdd08369470f2387a9d93d7d0f663fb42ba54ec3944529458513a3116426fdb7b04c'
        })
    },
    /**
     * 搜索热词
     */
    hotSearch() {
        return axios.post(base.hotSearch, {
            params: 'ikaNhLnNLlCL8Pa4Pp48IzqZYMV4z+ASy5eJjjh8azI=',
            encSecKey: '29760ce1cab2c34d347fa45d227b532f494058bab35f43612a63026e4fcc1c3c35a530ec2bae9ce83b910a2d93e3857225fee7c3dbaac81f180b5b96eefff490bf64a65026a5412f40a6e26b7714e6b1927d0552e0d573067e08e7cee48613076e12c16fe0b1f6f6e7f33070e68f9902cf1d335277aa9169d3258527663cd88a'
        })
    },
    /**
     * 搜索关键字接口
     * 请求方式：get
     * 参数：params = {
     *     必传  keywords  string  关键字
     *     必传  type  string  'mobile'移动端/不传为pc端
     * }
     */
    search(params) {
       return axios.get(base.search, {
           params
       })
    },
    /**
     * 首页-推荐列表界面
     * 进入推荐-列表界面的歌曲是固定的内容，而不是随着变化的，因为参数加密无法处理
     */
    musicplaylist() {
        return axios.post(base.musicplaylist, {
            params: 'Vh4E3SkRqdC614ZSFnx5lQ1e+4zlxv4lNK0mR7lLMlrZwP6ie8YuOj+Cop9kkpzB2RxVbYaP3eoyfC1PI28QhsGM9wL++65KKhLjFV6Gurk=',
            encSecKey: '7596b330fa707a5f1b0c83f002886c72bc7f8016e98b843aa565b0bbb1195ecc8be7bcc3f0a26245e627e015876285681e343d701139831ddb8fb96d4922486ee7cefddce603becda168f79db20232d7cc2ea89056df041a44f0da1dcaef77281a00c54b37d05a5f13cc4122e0c2d264ef668cdef9f81b6e7b7cf395f47a5358'
        })
    },
    /**
     * 音乐播放地址
     */
    songUrl() {
        return axios.post(base.songUrl, {
            params: 'ZDrmtp63oFUk0qfKgeJsusqx74qL39Zg8H6nWe/aruB7GYiskGMGwFWaT5YIG3X7NbqZYb1K1eiCi/MKNPIQ1wnP9otSQjSrYbV188cdPW/lHIFmZXKCdghr2jfFOkvr',
            encSecKey: '3db0f8ad850114ed27204e0dd0d4489bba2705443fc4a53c713bf192045a8d31d4ec8e04896ca02824bc1e37bab0bec3167f15c53e669d0b87a6bf00f058fe5a0d7c764fa1445e983e19ccbae686e535b50e1ab79aad0fc4420cd00b761e6b9a3adb6783a276a996262e3800826f33cd5530c5bee441be2468575eb5f4609327'
        })
    },
    /**
     * 获取歌词
     */
    getLyric(params) {
        return axios.get(base.lyric, {
            params
        })
    }
}

export default api;















